<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
    	<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
		<meta name="format-detection" content="telephone=no" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-touch-fullscreen" content="yes"> 
		<meta content="telephone=no,email=no" name="format-detection" />
        <meta name="flexible" content="initial-dpr=2,maximum-dpr=3" />
		
		<title>羊仓健康生活家</title>
		<link rel="stylesheet" href="../css/index.css" />
		<link rel="stylesheet" href="../css/gwc.css" />
		<link rel="stylesheet" href="../css/style.css" />
		<link rel="stylesheet" href="../css/mui.min.css" />
		<link rel="stylesheet" href="../css/app.css" />
		<script type="text/javascript" src="../js/jquery.min.js" ></script>
		<script type="text/javascript" src="../js/gwc.js" ></script>
		<script type="text/javascript" src="../js/flexible.js" ></script>
		<script type="text/javascript" src="../js/mui.min.js" ></script>
		<script type="text/javascript" src="../js/Calculation.js" ></script>
		
	</head>
	<body>
		<div class="warp">
			<!--头部-->
			
			<div class="topTitle">
				<a class="topReturn" onclick="history.go(-1)">
			        <img src="../img/baxk.png" alt="">
			    </a>
			    <h5 class="title">购物车</h5>
			    <p class="hrefgwc">完成</p>
			</div>
	<!--商品购物开始-->
	
		<div class="catbox mui-content">
			<ul id="OA_task_1" class="catul mui-table-view gwc_tb2">
				<li class="catlist mui-table-view-cell" style="padding: 0;">
					<div class="mui-slider-right mui-disabled">
						<a class="mui-btn" style="transform: translate(-50px, 0px);padding: 0 10px ; background: #007234;"><img src="../img/delete.png"></a>
					</div>
					
					<div class="catlist mui-slider-handle">
						<div class="list-left">
							<input class="left-jpg newslist" id="newslist-1" name="newslist" value="1" type="checkbox" />
								
						</div>
						<div class="list-right">
							<div class="right-jpg">
								<img src="../img/06.png">
							</div>
							<div class="right-txt">
								<p>珍惜天地天然营养富硒鸡蛋 年卡 30枚/每月*12</p>
								<div class="right-conten">
									<p class="right-mony price" id="total1">￥2376.00</p>
									<div class="right-btn">
										<input type="button" value="-" class="min" id="min1">
										<input type="text" value="1" class="number" id="number1">
										<input type="button" value="+" class="add" id="add1">
									</div>
								</div>
							</div>
						</div>
					</div>
				</li>
					<li class="catlist mui-table-view-cell" style="padding: 0;">
					<div class="mui-slider-right mui-disabled">
						<a class="mui-btn" style="transform: translate(-50px, 0px);padding: 0 10px ; background: #007234;"><img src="../img/delete.png"></a>
					</div>
					
					<div class="catlist mui-slider-handle">
						<div class="list-left">
							<input class="left-jpg newslist" id="newslist-2" name="newslist"  value="1" type="checkbox" />
							<!--<div class="left-jpg">
								<img src="img/good.png">
							</div>-->
						</div>
						<div class="list-right">
							
							<div class="right-jpg">
								<img src="../img/06.png">
							</div>
							<div class="right-txt">
								<p>珍惜天地天然营养富硒鸡蛋 年卡 30枚/每月*12</p>
								<div class="right-conten">
									<p class="right-mony price" id="total2">￥2376.00</p>
									<div class="right-btn">
										<input type="button" value="-" class="min" id="min2"/>
										<!--<input type="text" value="1" class="number" id="text_box2"/>-->
										<input id="number2" name="" type="text" class="number" value="1" />
										<!--<div class="number">
											<p>1</p>
										</div>-->
										<input type="button" value="+" class="add" id="add2">
									</div>
								</div>
							</div>
						</div>
					</div>
				</li>	
			</ul>
		</div>
	<!--商品结束-->
	<!--<总价结算开始>-->
		<div class="settlement">
			<div class="set-left">
				<input class="set-jpg newslist allselect" id="Checkbox1" value="1" type="checkbox" />
				<!--<div class="set-jpg">
					<img src="img/good.png">
				</div>-->
			</div>
			<p class="setqx">全选<span id="shuliang">(0)</span></p>
			<div class="set-right">
				<button>删除</button>
			</div>
			<p class="setmony price" id="zong1">￥0.00</p>
		</div>
		<!--<总价结算结束>-->
	
		<!--底导航开始-->
			<div id="nav">
				<ul class="nav-ul">
					<li><a href="index.html"><img src="../img/1.png"><p>首页</p></a></li>
					<li><a href="xsg.html"><img src="../img/2.png"><p>限时购</p></a></li>
					<li><a href="mryx.html"><img src="../img/3.png"><p>每日优选</p></a></li>
					<li><a href="gwc.html"><img src="../img/04—.png"><p  style="color:#007234">购物车</p></a></li>
					<li><a href="my.html"><img src="../img/5.png"><p>我的</p></a></li>
				</ul>
			</div>
		<!--底导航开始-->
		</div>
	</body>
		<script>
			mui.init();
			(function($) {
				
				$('#OA_task_1').on('tap', '.mui-btn', function(event) {
					var elem = this;
					var li = elem.parentNode.parentNode;
					mui.confirm('确认删除该条记录？', '', btnArray, function(e) {
						if (e.index == 0) {
							li.parentNode.removeChild(li);
						} else {
							setTimeout(function() {
								$.swipeoutClose(li);
							}, 0);
						}
					});
				});
				var btnArray = ['确认', '取消'];
				
			})(mui);
		</script>
		<script>
//加减算法
$(function () {
		var t = $("#number1");
		$("#add1").click(function () {
			t.val(parseInt(t.val()) + 1)
			setTotal(); GetCount();
		})
		$("#min1").click(function () {
			t.val(parseInt(t.val()) - 1)
			setTotal(); GetCount();
		})
		function setTotal() {

			$("#total1").html((parseInt(t.val()) * 2376).toFixed(2));
			$("#newslist-1").val(parseInt(t.val()) * 2376);
		}
		setTotal();
})	;
		</script>
		
		<!--加减算法-->
		<script>
		$(function () {
		var t = $("#number2");
		$("#add2").click(function () {
			t.val(parseInt(t.val()) + 1)
			setTotal(); GetCount();
		})
		$("#min2").click(function () {
			t.val(parseInt(t.val()) - 1)
			setTotal(); GetCount();
		})
		function setTotal() {

			$("#total2").html((parseInt(t.val()) * 2).toFixed(2));
			$("#newslist-2").val(parseInt(t.val()) * 2);
		}
		setTotal();
	});

		</script>

	<script>
	function GetCount() {
	var conts = 0;
	var aa = 0;
	$(".gwc_tb2 input[name=newslist]").each(function () {
		if ($(this).attr("checked")) {
			for (var i = 0; i < $(this).length; i++) {
				conts += parseInt($(this).val());
				aa += 1;
			}
		}
	});
	$("#shuliang").text(aa);
	$("#zong1").html((conts).toFixed(2));
	
};
		</script>
		<script>
	$(function () {
	// 全选        
	$(".allselect").click(function () {
//		alert(1)
		$(".gwc_tb2 input[name=newslist]").each(function () {
//			alert(1)
			$(this).attr("checked", true);
		});
		GetCount();
	});
// 输出
	$(".gwc_tb2 input[name=newslist]").click(function () {
		$(this).attr("checked", true);
		GetCount();
	});
});	
		</script>
		<script>
			$('.hrefgwc').click(function(){
//				alert(1)
				window.location.href="../gwc.html"
			})
		</script>
</html>

